FROM openjdk:8u181-alpine3.8
MAINTAINER atompi <coder.atompi@gmail.com>

ENV KE_HOME /app/eagle

WORKDIR /app
ADD kafka-eagle-web-1.2.6-bin.tar.gz /app
COPY supervisord.conf /app/etc/supervisord.conf
COPY system-config.properties /app/etc/system-config.properties
RUN mv /app/kafka-eagle-web-1.2.6 /app/eagle \
    && sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories \
    && apk update \
    && apk add --no-cache \
    supervisor \
    && mkdir /lib64 \
    && ln -sf /lib/libc.musl-x86_64.so.1 /lib64/ld-linux-x86-64.so.2 \
    && ln -sf /app/etc/supervisord.conf /etc/supervisord.conf \
    && ln -sf /app/etc/system-config.properties /app/eagle/conf/system-config.properties \
    && chmod +x ${KE_HOME}/bin/ke.sh

EXPOSE 8088
ENTRYPOINT ["/usr/bin/supervisord"]